﻿<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%String path = request.getContextPath(); %> 
<!DOCTYPE html>
<html>
<head>
<title>新闻详情</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<link href="<%=path%>/resources/css/pages/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=path%>/resources/script/js/jquery-1.8.0.min.js" ></script>
<script  type="text/javascript" src="<%=path%>/resources/script/js/vue.js"></script>
<script type="text/javascript" src="<%=path%>/resources/script/js/js.js" ></script>
</head>
<body>
<div id="contentBody">
<div class="top" id="toubu">
  <div class="top-ct">
   <h3 class="logo"></h3> 
   <span id='span'>
       <a href="<%=path%>/pages/login" id='plogin'><span >您好，请登录！</span></a>
       <a href="<%=path%>/pages/userInfo?userid=${loginUser.id}" id='pshow'><span>${loginUser.nickName}（${loginUser.account }）</span></a>
    </span>
  <p><a href="<%=path%>/index" class="select" >首页</a>
	<a href="<%=path%>/pages/mycourse?userid=${loginUser.id}">我的课程</a>
	<a href="<%=path%>/pages/learnhistory?userid=${loginUser.id}">学习历史</a><a href="javascript:void(0);">我的技能</a></p> 
    </div>
</div>

<div id="main">
<div class="ny-ban"><img src="<%=path%>/resources/images/pages/images/ny-ban.jpg"></div>
<div class="position">
 <p><a href="<%=path%>/index" class="syx">首页</a> ><a href="javascrip]">新闻资讯</a></p>
 <form>
  <label><input type="text"  placeholder="搜索新闻标题" class="ssbt"></label>
  <label><input type="submit" class="ssan" value=""></label>
 
 </form>
</div>

<div class="ny-left">
 <h3><span  class="select"></span><a href="javascript:void(0);">新闻资讯</a></h3> 

</div>
<div class="ny-right">

<div class="news_article">
    <h2>{{CurrNews.title}}</h2>
 <span> 组织部&nbsp;   宣传部  &nbsp;&nbsp;&nbsp;    {{CurrNews.createTime}}</span> 
 <p> {{{CurrNews.content}}}</p>
   

</div>
<div class="index-article">
<div>
<p><b>上一篇：</b> <a href="<%=path%>/pages/newsdetail?id={{PreNews.id}}">{{PreNews.title}}</a></p>
<p><b>下一篇：</b> <a href="<%=path%>/pages/newsdetail?id={{NextNews.id}}">{{NextNews.title}}</a></p>
 </div>

</div>
</div>


<div class="clear"></div>
</div>
<div class="foot">
<div class="foot-top"></div>
<div class="foot-ct"><p>Copyright © 2016 业主单位：福建工程学院，建设单位：福州森泽信息科技有限公司 技术服务热线：87862229
   <a href="#"><img src="<%=path%>/resources/images/pages/images/cnzz.jpg"></a></p></div>

</div>
<div class="fhdb">
  <a href="<%=path%>/index" id="sy"></a>
  <a href="#toubu" id="dingbu"></a>
</div>
</div>
<script type="text/javascript">
    $(function(){
    	var urlStr=location.search;
    	var urlPara=[];
    	var parObj=new Object();
    	if(urlStr.indexOf("?")!=-1)
		{
			urlPara=urlStr.substr(urlStr.indexOf("?")+1).split("&");
		}
		for(var i=0;i<urlPara.length;i++)
		{
				parObj[urlPara[i].split("=")[0].toString()]=urlPara[i].split("=")[1].toString();
		}
		var vmMain=new Vue({
    		el:'#contentBody',
    		data:{
    			CurrNews:{},
    			PreNews:{},
    			NextNews:{}
    		}
    	});
    	   $.ajax({
    		    url:"currentNew",
    		    type:"POST",
    		    dataType:"json",
    	        data:{id:parObj["id"]},
    		    success:function(result)
    		    {	
    		    	vmMain.CurrNews=result;
    		    },
    		    error:function(result){
    		    	return;
    		    }
    	   });
    	   $.ajax({
    		    url:"frontNew",
    		    type:"POST",
    		    dataType:"json",
    		    data:{id:parObj["id"]},
    		    success:function(result)
    		    {
    		    	if(result)
    		    	    vmMain.PreNews=result;
    		    	else
    		    		vmMain.PreNews.id=null;
    		    },
    		    error:function(result){
    		    	vmMain.PreNews.id=null;
    		    	return;
    		    }
    	   });
    	   $.ajax({
    		    url:"nextNew",
    		    type:"POST",
    		    dataType:"json",
    		    data:{id:parObj["id"]},
    		    success:function(result)
    		    {	
    		    	if(result)
    		    	    vmMain.NextNews=result;
    		    	else
    		    		vmMain.NextNews.id=null;
    		    },
    		    error:function(result){
    		    	vmMain.NextNews.id=null;
    		    	return;
    		    }
    	   });
    });
</script>
<script type="text/javascript"  language="JavaScript">
$(function(){
	var myName='${loginUser.account}';
	if(myName==""||myName==undefined)
	{
		document.getElementById('plogin').setAttribute("style", "display:inline");
		document.getElementById('pshow').setAttribute("style", "display:none");
	}
	else{
		document.getElementById('plogin').setAttribute("style", "display:none");
		document.getElementById('pshow').setAttribute("style", "display:inline");
	}
});
</script>
</body>
</html>
